]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Move monitor management to KeyboardController
authorCarlos Garnacho <carlosg@gnome.org>
Thu, 11 Feb 2021 15:44:28 +0000 (16:44 +0100)
committerMarge Bot <marge-bot@gnome.org>
Wed, 17 Feb 2021 15:45:01 +0000 (15:45 +0000)
Instead of setting it deep down, manage it at the higher level.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1668>

js/ui/keyboard.js

index 4f5bd25db9f4e5bae780885d5b495f9413296a67..a5304edace9828060fa8405fe03d56ce4485cd1f 100644 (file)
@@ -1194,8 +1194,10 @@ var KeyboardManager = class KeyBoardManager {
     }
 
     open(monitor) {
+        Main.layoutManager.keyboardIndex = monitor;
+
         if (this._keyboard)
-            this._keyboard.open(monitor);
+            this._keyboard.open();
     }
 
     close() {
@@ -1723,15 +1725,12 @@ var Keyboard = GObject.registerClass({
         this._keyboardRestingId = 0;
     }
 
-    open(monitor) {
+    open() {
         this._clearShowIdle();
         this._keyboardRequested = true;
 
         if (this._keyboardVisible) {
-            if (monitor != Main.layoutManager.keyboardIndex) {
-                Main.layoutManager.keyboardIndex = monitor;
-                this._relayout();
-            }
+            this._relayout();
             return;
         }
 
@@ -1740,17 +1739,16 @@ var Keyboard = GObject.registerClass({
             KEYBOARD_REST_TIME,
             () => {
                 this._clearKeyboardRestTimer();
-                this._open(monitor);
+                this._open();
                 return GLib.SOURCE_REMOVE;
             });
         GLib.Source.set_name_by_id(this._keyboardRestingId, '[gnome-shell] this._clearKeyboardRestTimer');
     }
 
-    _open(monitor) {
+    _open() {
         if (!this._keyboardRequested)
             return;
 
-        Main.layoutManager.keyboardIndex = monitor;
         this._relayout();
         this.animateShow();